.class public Lcom/philzhu/www/ddz/Settings;
.super Ljava/lang/Object;
.source "Settings.java"


# static fields
.field public static final LEVEL_UPGRADE_EXP:I = 0x19

.field public static exp:I

.field public static isWithCardsIdenticalAllowed:Z

.field public static lastNoGoldTime:J

.field public static level:I

.field public static score:I

.field private static soundEnabled:Z


# direct methods
.method static constructor <clinit>()V
    .locals 3

    .prologue
    const/4 v2, 0x1

    .line 15
    sput-boolean v2, Lcom/philzhu/www/ddz/Settings;->soundEnabled:Z

    .line 16
    const/16 v0, 0xc8

    sput v0, Lcom/philzhu/www/ddz/Settings;->score:I

    .line 17
    sput v2, Lcom/philzhu/www/ddz/Settings;->level:I

    .line 18
    const/4 v0, 0x0

    sput v0, Lcom/philzhu/www/ddz/Settings;->exp:I

    .line 19
    const-wide/16 v0, 0x0

    sput-wide v0, Lcom/philzhu/www/ddz/Settings;->lastNoGoldTime:J

    .line 20
    sput-boolean v2, Lcom/philzhu/www/ddz/Settings;->isWithCardsIdenticalAllowed:Z

    .line 14
    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 14
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static addExp()V
    .locals 1

    .prologue
    .line 88
    sget v0, Lcom/philzhu/www/ddz/Settings;->exp:I

    add-int/lit8 v0, v0, 0x1

    sput v0, Lcom/philzhu/www/ddz/Settings;->exp:I

    .line 89
    return-void
.end method

.method public static addLevel()V
    .locals 1

    .prologue
    .line 74
    sget v0, Lcom/philzhu/www/ddz/Settings;->level:I

    add-int/lit8 v0, v0, 0x1

    sput v0, Lcom/philzhu/www/ddz/Settings;->level:I

    .line 75
    return-void
.end method

.method public static addScore(I)V
    .locals 1
    .parameter "baseScore"

    .prologue
    .line 92
    sget v0, Lcom/philzhu/www/ddz/Settings;->score:I

    add-int/2addr v0, p0

    sput v0, Lcom/philzhu/www/ddz/Settings;->score:I

    .line 93
    sget v0, Lcom/philzhu/www/ddz/Settings;->score:I

    if-gez v0, :cond_0

    .line 95
    const/4 v0, 0x0

    sput v0, Lcom/philzhu/www/ddz/Settings;->score:I

    .line 97
    :cond_0
    return-void
.end method

.method public static getSoundEnabled()Z
    .locals 1

    .prologue
    .line 114
    sget-boolean v0, Lcom/philzhu/www/ddz/Settings;->soundEnabled:Z

    return v0
.end method

.method public static load(Lcom/philzhu/www/framework/FileIO;)V
    .locals 4
    .parameter "files"

    .prologue
    .line 24
    const/4 v0, 0x0

    .line 26
    .local v0, in:Ljava/io/BufferedReader;
    :try_start_0
    new-instance v1, Ljava/io/BufferedReader;

    new-instance v2, Ljava/io/InputStreamReader;

    .line 27
    const-string v3, ".ddz2"

    invoke-interface {p0, v3}, Lcom/philzhu/www/framework/FileIO;->readFile(Ljava/lang/String;)Ljava/io/InputStream;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;)V

    .line 26
    invoke-direct {v1, v2}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_2

    .line 28
    .end local v0           #in:Ljava/io/BufferedReader;
    .local v1, in:Ljava/io/BufferedReader;
    :try_start_1
    invoke-virtual {v1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/Boolean;->parseBoolean(Ljava/lang/String;)Z

    move-result v2

    sput-boolean v2, Lcom/philzhu/www/ddz/Settings;->soundEnabled:Z

    .line 29
    invoke-virtual {v1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v2

    sput v2, Lcom/philzhu/www/ddz/Settings;->score:I

    .line 30
    invoke-virtual {v1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v2

    sput v2, Lcom/philzhu/www/ddz/Settings;->level:I

    .line 31
    invoke-virtual {v1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v2

    sput v2, Lcom/philzhu/www/ddz/Settings;->exp:I

    .line 32
    invoke-virtual {v1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v2

    sput-wide v2, Lcom/philzhu/www/ddz/Settings;->lastNoGoldTime:J
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_7
    .catch Ljava/lang/NumberFormatException; {:try_start_1 .. :try_end_1} :catch_6

    .line 40
    if-eqz v1, :cond_2

    .line 41
    :try_start_2
    invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_4

    move-object v0, v1

    .line 45
    .end local v1           #in:Ljava/io/BufferedReader;
    .restart local v0       #in:Ljava/io/BufferedReader;
    :cond_0
    :goto_0
    return-void

    .line 34
    :catch_0
    move-exception v2

    .line 40
    :goto_1
    if-eqz v0, :cond_0

    .line 41
    :try_start_3
    invoke-virtual {v0}, Ljava/io/BufferedReader;->close()V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_1

    goto :goto_0

    .line 42
    :catch_1
    move-exception v2

    goto :goto_0

    .line 36
    :catch_2
    move-exception v2

    .line 40
    :goto_2
    if-eqz v0, :cond_0

    .line 41
    :try_start_4
    invoke-virtual {v0}, Ljava/io/BufferedReader;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_3

    goto :goto_0

    .line 42
    :catch_3
    move-exception v2

    goto :goto_0

    .line 38
    :catchall_0
    move-exception v2

    .line 40
    :goto_3
    if-eqz v0, :cond_1

    .line 41
    :try_start_5
    invoke-virtual {v0}, Ljava/io/BufferedReader;->close()V
    :try_end_5
    .catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_5

    .line 44
    :cond_1
    :goto_4
    throw v2

    .line 42
    .end local v0           #in:Ljava/io/BufferedReader;
    .restart local v1       #in:Ljava/io/BufferedReader;
    :catch_4
    move-exception v2

    move-object v0, v1

    .end local v1           #in:Ljava/io/BufferedReader;
    .restart local v0       #in:Ljava/io/BufferedReader;
    goto :goto_0

    :catch_5
    move-exception v3

    goto :goto_4

    .line 38
    .end local v0           #in:Ljava/io/BufferedReader;
    .restart local v1       #in:Ljava/io/BufferedReader;
    :catchall_1
    move-exception v2

    move-object v0, v1

    .end local v1           #in:Ljava/io/BufferedReader;
    .restart local v0       #in:Ljava/io/BufferedReader;
    goto :goto_3

    .line 36
    .end local v0           #in:Ljava/io/BufferedReader;
    .restart local v1       #in:Ljava/io/BufferedReader;
    :catch_6
    move-exception v2

    move-object v0, v1

    .end local v1           #in:Ljava/io/BufferedReader;
    .restart local v0       #in:Ljava/io/BufferedReader;
    goto :goto_2

    .line 34
    .end local v0           #in:Ljava/io/BufferedReader;
    .restart local v1       #in:Ljava/io/BufferedReader;
    :catch_7
    move-exception v2

    move-object v0, v1

    .end local v1           #in:Ljava/io/BufferedReader;
    .restart local v0       #in:Ljava/io/BufferedReader;
    goto :goto_1

    .end local v0           #in:Ljava/io/BufferedReader;
    .restart local v1       #in:Ljava/io/BufferedReader;
    :cond_2
    move-object v0, v1

    .end local v1           #in:Ljava/io/BufferedReader;
    .restart local v0       #in:Ljava/io/BufferedReader;
    goto :goto_0
.end method

.method public static save(Lcom/philzhu/www/framework/FileIO;)V
    .locals 4
    .parameter "files"

    .prologue
    .line 48
    const/4 v0, 0x0

    .line 50
    .local v0, out:Ljava/io/BufferedWriter;
    :try_start_0
    new-instance v1, Ljava/io/BufferedWriter;

    new-instance v2, Ljava/io/OutputStreamWriter;

    .line 51
    const-string v3, ".ddz2"

    invoke-interface {p0, v3}, Lcom/philzhu/www/framework/FileIO;->writeFile(Ljava/lang/String;)Ljava/io/OutputStream;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/io/OutputStreamWriter;-><init>(Ljava/io/OutputStream;)V

    .line 50
    invoke-direct {v1, v2}, Ljava/io/BufferedWriter;-><init>(Ljava/io/Writer;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 52
    .end local v0           #out:Ljava/io/BufferedWriter;
    .local v1, out:Ljava/io/BufferedWriter;
    :try_start_1
    sget-boolean v2, Lcom/philzhu/www/ddz/Settings;->soundEnabled:Z

    invoke-static {v2}, Ljava/lang/Boolean;->toString(Z)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/io/BufferedWriter;->write(Ljava/lang/String;)V

    .line 53
    const-string v2, "\n"

    invoke-virtual {v1, v2}, Ljava/io/BufferedWriter;->write(Ljava/lang/String;)V

    .line 54
    sget v2, Lcom/philzhu/www/ddz/Settings;->score:I

    invoke-static {v2}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/io/BufferedWriter;->write(Ljava/lang/String;)V

    .line 55
    const-string v2, "\n"

    invoke-virtual {v1, v2}, Ljava/io/BufferedWriter;->write(Ljava/lang/String;)V

    .line 56
    sget v2, Lcom/philzhu/www/ddz/Settings;->level:I

    invoke-static {v2}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/io/BufferedWriter;->write(Ljava/lang/String;)V

    .line 57
    const-string v2, "\n"

    invoke-virtual {v1, v2}, Ljava/io/BufferedWriter;->write(Ljava/lang/String;)V

    .line 58
    sget v2, Lcom/philzhu/www/ddz/Settings;->exp:I

    invoke-static {v2}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/io/BufferedWriter;->write(Ljava/lang/String;)V

    .line 59
    const-string v2, "\n"

    invoke-virtual {v1, v2}, Ljava/io/BufferedWriter;->write(Ljava/lang/String;)V

    .line 60
    sget-wide v2, Lcom/philzhu/www/ddz/Settings;->lastNoGoldTime:J

    invoke-static {v2, v3}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/io/BufferedWriter;->write(Ljava/lang/String;)V

    .line 61
    const-string v2, "\n"

    invoke-virtual {v1, v2}, Ljava/io/BufferedWriter;->write(Ljava/lang/String;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_4

    .line 65
    if-eqz v1, :cond_2

    .line 66
    :try_start_2
    invoke-virtual {v1}, Ljava/io/BufferedWriter;->close()V
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_2

    move-object v0, v1

    .line 70
    .end local v1           #out:Ljava/io/BufferedWriter;
    .restart local v0       #out:Ljava/io/BufferedWriter;
    :cond_0
    :goto_0
    return-void

    .line 62
    :catch_0
    move-exception v2

    .line 65
    :goto_1
    if-eqz v0, :cond_0

    .line 66
    :try_start_3
    invoke-virtual {v0}, Ljava/io/BufferedWriter;->close()V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_1

    goto :goto_0

    .line 67
    :catch_1
    move-exception v2

    goto :goto_0

    .line 63
    :catchall_0
    move-exception v2

    .line 65
    :goto_2
    if-eqz v0, :cond_1

    .line 66
    :try_start_4
    invoke-virtual {v0}, Ljava/io/BufferedWriter;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_3

    .line 69
    :cond_1
    :goto_3
    throw v2

    .line 67
    .end local v0           #out:Ljava/io/BufferedWriter;
    .restart local v1       #out:Ljava/io/BufferedWriter;
    :catch_2
    move-exception v2

    move-object v0, v1

    .end local v1           #out:Ljava/io/BufferedWriter;
    .restart local v0       #out:Ljava/io/BufferedWriter;
    goto :goto_0

    :catch_3
    move-exception v3

    goto :goto_3

    .line 63
    .end local v0           #out:Ljava/io/BufferedWriter;
    .restart local v1       #out:Ljava/io/BufferedWriter;
    :catchall_1
    move-exception v2

    move-object v0, v1

    .end local v1           #out:Ljava/io/BufferedWriter;
    .restart local v0       #out:Ljava/io/BufferedWriter;
    goto :goto_2

    .line 62
    .end local v0           #out:Ljava/io/BufferedWriter;
    .restart local v1       #out:Ljava/io/BufferedWriter;
    :catch_4
    move-exception v2

    move-object v0, v1

    .end local v1           #out:Ljava/io/BufferedWriter;
    .restart local v0       #out:Ljava/io/BufferedWriter;
    goto :goto_1

    .end local v0           #out:Ljava/io/BufferedWriter;
    .restart local v1       #out:Ljava/io/BufferedWriter;
    :cond_2
    move-object v0, v1

    .end local v1           #out:Ljava/io/BufferedWriter;
    .restart local v0       #out:Ljava/io/BufferedWriter;
    goto :goto_0
.end method

.method public static setExp(I)V
    .locals 0
    .parameter "newExp"

    .prologue
    .line 79
    sput p0, Lcom/philzhu/www/ddz/Settings;->exp:I

    .line 80
    return-void
.end method

.method public static setLastNoGoldTime(Ljava/lang/Long;)V
    .locals 2
    .parameter "noGoldTime"

    .prologue
    .line 83
    invoke-virtual {p0}, Ljava/lang/Long;->longValue()J

    move-result-wide v0

    sput-wide v0, Lcom/philzhu/www/ddz/Settings;->lastNoGoldTime:J

    .line 84
    return-void
.end method

.method public static toggleSound()V
    .locals 1

    .prologue
    .line 101
    sget-boolean v0, Lcom/philzhu/www/ddz/Settings;->soundEnabled:Z

    if-eqz v0, :cond_0

    .line 103
    const/4 v0, 0x0

    sput-boolean v0, Lcom/philzhu/www/ddz/Settings;->soundEnabled:Z

    .line 110
    :goto_0
    return-void

    .line 107
    :cond_0
    const/4 v0, 0x1

    sput-boolean v0, Lcom/philzhu/www/ddz/Settings;->soundEnabled:Z

    .line 108
    sget-object v0, Lcom/philzhu/www/ddz/Assets;->sMusicOn:Lcom/philzhu/www/framework/Sound;

    invoke-static {v0}, Lcom/philzhu/www/ddz/Assets;->playSound(Lcom/philzhu/www/framework/Sound;)V

    goto :goto_0
.end method
